package lock;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

public class HashMapDeepLock {
    public static void main(String[] args) {
        HashMapDeepLock lock = new HashMapDeepLock();
        lock.Multthread();


    }

    public void Multthread() {
        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    Map map = new ConcurrentHashMap<String, String>();
                    AtomicInteger atomicInteger = new AtomicInteger();
                    for (int i = 0; i < 100000; i++) {
                        //System.out.println("正在写");
                        map.put(atomicInteger.get(), atomicInteger.get());
                    }
                }
            }).start();
        }
    }


}
